var name = 'window' //window.name = 'window'
function Person(name) {
  this.name = name
  this.foo1 = function () {
    console.log(this.name)
  },
    this.foo2 = () => {
      console.log(this.name);
    },
    this.foo3 = function () {
      return function () {
        console.log(this.name)
      }
    },
    this.foo4 = function () {
      return () => {
        console.log(this.name)
      }
    }
  
}

var person1 = new Person('person1')
var person2 = new Person('person2')

person1.foo1() //person1
person1.foo1.call(person2) //person2

person1.foo2() //person1 上层作用域找
person1.foo2.call(person2) //person1 上层作用域找，显示绑定对arrow function无效

person1.foo3()() //window 全局调用，独立调用
person1.foo3.call(person2)() //window
person1.foo3().call(person2) //person2

person1.foo4()() //person1
person1.foo4.call(person2)() //person2
person1.foo4().call(person2) //person1
